#ifndef ABSTRACTDELEGATE_H
#define ABSTRACTDELEGATE_H

#include <QStyledItemDelegate>
#include <QPainter>

class AbstractDelegate : public QStyledItemDelegate
{
  Q_OBJECT
public:
  explicit AbstractDelegate(QObject *parent = 0);
  QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;

  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;

protected:
  virtual int fontSize(const QRect& r) const =0;
  virtual int leftMargin(const QRect& r) const=0;

  virtual QBrush rectBrush(const QRect& r) const=0;
  virtual QBrush selectedRectBrush(const QRect& r) const=0;
  virtual QPen rectPen(const QRect& r) const=0;
  virtual QPen selectedRectPen(const QRect& r) const=0;

  virtual QPen textPen(const QRect& r) const=0;
  virtual QPen selectedTextPen(const QRect& r) const=0;
  virtual QPen disabledTextPen(const QRect& r) const=0;
};

#endif // ABSTRACTDELEGATE_H
